07. Exercise: Set up the shapes

23 7 AAK Shapes SC - Step 4- Set Up The Shapes V2

Exercise

In this exercise you will set up the shapes.

  1. In ClippedView, below the path, add variables for dimensions for a clipping rectangle around the whole set of shapes.
private val clipRectRight = resources.getDimension(R.dimen.clipRectRight)
private val clipRectBottom = resources.getDimension(R.dimen.clipRectBottom)
private val clipRectTop = resources.getDimension(R.dimen.clipRectTop)
private val clipRectLeft = resources.getDimension(R.dimen.clipRectLeft)
  1. Add variables for the inset of a rectangle and the offset of a small rectangle.
private val rectInset = resources.getDimension(R.dimen.rectInset)
private val smallRectOffset = resources.getDimension(R.dimen.smallRectOffset)
  1. Add a variable for the radius of a circle. This is the circle that is drawn inside the rectangle.
private val circleRadius = resources.getDimension(R.dimen.circleRadius)
  1. Add an offset and a text size for text that is drawn inside the rectangle.
private val textOffset = resources.getDimension(R.dimen.textOffset)
private val textSize = resources.getDimension(R.dimen.textSize)